﻿{include file='pub/header'/}
<title>订单列表</title>
</head>

<body class="pos-r">
<nav class="breadcrumb">{$breadNav} <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
                                       href="javascript:location.replace(location.href);" title="刷新"><i
        class="Hui-iconfont">&#xe68f;</i></a></nav>
    <div class="page-container">
        <div class="cl pd-5 bg-1 bk-gray mt-20">
            <!--<span class="l">-->
                <!--<a class="btn btn-primary radius" onclick="downloadOrder()" href="javascript:;">-->
                    <!--<i class="Hui-iconfont">&#xe640;</i> 下载订单-->
                <!--</a>-->
            <!--</span>-->
        </div>
        <div class="mt-20">
            <table class="table table-border table-bordered table-bg table-hover table-sort">
                <thead>
                <tr class="text-c">
                    <th width="60">下单时间</th>
                    <th width="60">兑换商品</th>
                    <th width="60">下单会员</th>
                    <th width="30">收货人姓名</th>
                    <th width="30">收货人电话</th>
                    <th width="30">收货人地址</th>
                    <th width="30">收货人备注</th>
                    <th width="30">订单状态</th>
                    <th width="100">操作</th>
                </tr>
                </thead>
                <tbody>
                {foreach $list as $item}
                <tr class="text-c va-m">
                    <td>{$item.create_time}</td>
                    <td>{$item.good_name}</td>
                    <td>{$item.username}</td>
                    <td class="is_send">
                        {$item.name}
                    </td>
                    <td>{$item.telephone}</td>
                    <td>{$item.address}</td>
                    <td>{$item.remarks}</td>
                    <td>
                        {if $item.status == 0}
                        未处理
                        {else/}
                        已处理
                        {/if}
                    </td>
                    <td>
                        <a style="text-decoration:none" class="ml-5" onClick="sure_order(this,'{$item.id}')"
                           href="javascript:;" title="处理">
                            <i class="Hui-iconfont">&#xe6a7;</i>订单处理
                        </a>
                    </td>
                </tr>
                {/foreach}
                </tbody>
            </table>
        </div>
    </div>

{include file='pub/footer'/}
<script type="text/javascript">
    $('.table-sort').dataTable({
        "aaSorting": [[1, "desc"]],//默认第几个排序
        "bStateSave": false,//状态保存
        "aoColumnDefs": [
            {"orderable": false, "aTargets": [8]}// 制定列不参与排序
        ],
    });

    //确认收获
    function sure_order(o, order_id) {
        layer.confirm("确认收获？", function () {
            $.post("{:url('sure_order_score')}", {'order_id': order_id}, function (res) {
                if (res.code == 1) {
                    location.reload();
                } else {
                    layer.msg(res.msg);
                }

            });
        });

    }

</script>
</body>
</html>